/*
 * @Date: 2022-09-16 09:20:00
 * @LastEditTime: 2022-09-16 09:23:02
 */
import Layout from '@/layout'

// 静态路由-所有人都可见的页面
export const Routes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },

  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
    {
      path: 'dashboard',
      name: '首页',
      component: () => import('@/views/dashboard/index'),
      meta: { title: '首页', icon: 'dashboard' }
    }
  ]
  }
]


// 动态路由(异步路由)-根据返回的数据动态添加到静态路由当中进行中展示

export const asyncRoutes = [
  // 动态的
  {
    path:'/authority',
    component:Layout,
    name:'Acl',
    meta:{title:'权限管理',icon:'el-icon-question'},
    children:[
      {
        path:'/authority/management',
        name:'User',
        component:()=>import('@/views/authority/management'),
        meta:{title:'用户管理'}
      },
      {
        path:'/authority/role',
        name:'Role',
        component:()=>import('@/views/authority/role'),
        meta:{title:'角色管理'}
      },
      {
        path:'/authority/menu',
        name:'Permission',
        component:()=>import('@/views/authority/menu'),
        meta:{title:'菜单管理'}
      }
    ]   
  },
  {
    path:'/fruit',
    component:Layout,
    name:'Fruit',
    meta:{title:'水果管理'},
    children:[
      {
        path:'/fruit/bann',
        name:'Bann',
        component:()=>import('@/views/fruit/bann'),
        meta:{title:'香蕉管理'}
      },
      {
        path:'/fruit/peach',
        name:'Peach',
        component:()=>import('@/views/fruit/peach'),
        meta:{title:'桃子管理'}
      }
    ]
  }
]


// 任意路由(对象)-输入地址不正确跳转到的路由,挡放在最后的位置当中

export const anyRoute ={
    path: '*',
   redirect: '/404',
   hidden: true 
  }



